/*
 *email: chen983@sina.com
 */
#ifndef _ORACLE_READER_IMP_SINGLE_H__
#define _ORACLE_READER_IMP_SINGLE_H__

#define SQLCA_STORAGE_CLASS extern
#define ORACA_STORAGE_CLASS extern
#include <stdio.h>
#include <sqlca.h>
#include <sqlda.h>
#include <sqlcpr.h>

#include "reader.h"

namespace Oracle
{
class ReaderimpSingle:public Reader
{
private:
	friend class Command;
	ReaderimpSingle(void *ctx, Command &command, bool open=true);
	virtual ~ReaderimpSingle();

public:
	virtual void open();
	virtual void close(bool deleteThis=true);
	virtual bool read();
	virtual void bindParameter(const char *value);
	virtual void bindOutputParameter(string &value);

private:
	void daAllocate(int size, int max_vname_len, int max_iname_len);
	
	void selectList();
	void bindList();
	
	void clear();
	void clearBindDes();
	
private:	
	void *_select_des;
	void *_bind_des;
	
	vector<BindParameter> bindVariables;	
};

};
#endif
